package com.dyb;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @ClassName : ServerBoot
 * @Description :
 * @Author : LinYa
 * @Date: 2022/6/14  14:57
 */
public class ServerBoot {

	private static final int PORT = 8080;

	private static final int MAX_INPUT = 500;

	public static void main(String[] args) {
		Object os = new Object();
		System.out.println(os);
		System.exit(0);


	}
	class Server implements Runnable{

		@Override
		public void run() {
			try {
				ServerSocket serverSocket = new ServerSocket(PORT);
				while (!Thread.interrupted()){
					new Thread(new Handler(serverSocket.accept())).start();
				}

			} catch (IOException e) {
				e.getStackTrace();
			}
		}
	}

	class Handler implements Runnable{

		final Socket socket;

		Handler(Socket socket) {
			this.socket = socket;
		}

		@Override
		public void run() {
			try {
				byte[] bytes = new byte[MAX_INPUT];
				socket.getInputStream().read(bytes);

			} catch (IOException e) {
				e.getStackTrace();
			}
		}
	}
}
